import type { PageDto } from './request'

type Status = 0 | 1 | 2 | 3 | 4 | 5 // 0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；5->无效订单
type OrderType = 0 | 1 // 0->正常订单；1->秒杀订单
type SourceType = 0 | 1 // 0->PC订单；1->app订单

export interface Order {
  id?: number
  memberId?: number
  couponId?: number
  orderSn?: string
  createTime?: string
  memberUsername?: string
  totalAmount?: number
  payAmount?: number
  freightAmount?: number
  promotionAmount?: number
  integrationAmount?: number
  couponAmount?: number
  discountAmount?: number
  payType?: number
  sourceType?: SourceType
  status?: Status
  orderType?: OrderType
  deliveryCompany?: string
  deliverySn?: string
  autoConfirmDay?: number
  integration?: number
  growth?: number
  promotionInfo?: string
  billType?: string
  billHeader?: string
  billContent?: string
  billReceiverPhone?: string
  billReceiverEmail?: string
  receiverName?: string
  receiverPhone?: string
  receiverPostCode?: string
  receiverProvince?: string
  receiverCity?: string
  receiverRegion?: string
  receiverDetailAddress?: string
  note?: string
  confirmStatus?: number
  deleteStatus?: number
  useIntegration?: string
  paymentTime?: string
  deliveryTime?: string
  receiveTime?: string
  commentTime?: string
  modifyTime?: string
}

export interface OrderPageParams extends PageDto {
  createTime: string
  orderSn: string
  orderType: OrderType
  receiverKeyword: string
  sourceType: SourceType
  status: Status
}

export interface OrderUpdateCloseParams {
  ids?: string
  note?: string
}

export interface OrderDeliveryParams {
  deliveryCompany: string
  deliverySn: string
  orderId: number
}

export interface OrderMoneyInfoParams {
  discountAmount?: number
  freightAmount?: number
  orderId?: number
  status?: Status
}

export interface OrderUpdateNoteParams {
  id?: number
  note?: string
  status?: Status
}

export interface OrderUpdateReceiverInfoParams {
  orderId?: number
  receiverCity?: string
  receiverDetailAddress?: string
  receiverName?: string
  receiverPhone?: string
  receiverPostCode?: string
  receiverProvince?: string
  receiverRegion?: string
  status?: Status
}
